<div id="mySlideshows" class="slideImages">
    <?php
    $uploadUrl =  $rootUrl . Yii::app()->params['upload_url'] . 'slideshows/';
    $jsonFilePath = Yii::app()->params['components_dir'] . 'slideshow.json';
    $slideshow = json_decode(file_get_contents($jsonFilePath), true);

    foreach ($slideshow as $row) {
        if (! isset($_GET['pvw'])) {
            if ($row['activated_flag']) {
                echo CHtml::image($uploadUrl . $row['file'], $row['title']);
            }
        } else {
            if ($row['preview_flag']) {
                echo CHtml::image($uploadUrl . $row['file'], $row['title']);
            }
        }
    }
    ?>

    <!-- empty element for Control next/prev -->
    <div class="slidePrev" id="slidePrev"></div>
    <div class="slideNext" id="slideNext"></div>
</div>

<script type="text/javascript">
$('#mySlideshows').cycle({
    log: false,
    pauseOnHover: true,
    timeout: <?php echo Yii::t('app', 'timeout_home_slide') ?>,
    fx: 'fade',
    prev: '#slidePrev',
    next: '#slideNext',
    pager: '.cycle-pager'
});    
</script>